		<div class="wrapper clearfix">
        <section class="cl_left">
            <?php $this->load->view('mod_email/menu');?>
        </section>
		<!-- /.cl_left -->
    <div class="primary">
       <?php
            if(!empty($mangnoi))
                {
                    ?>
                <br/>
				<article id="main_primary">
                      <section class="main_email traloi_mail">
                    <?php foreach ($mangnoi as $email)
                        {
                            $mail_info = $this->common_model->getone('users',array('email'=>$email->email_from),array('id','avartar','name','type'));
                            $img = explode(',',$mail_info->avartar);
                            ?>
                            
                                    <?php if($email->email_from != $this->session->userdata('email')) { ?>
                                        <div class="box_noidung clearfix">
                                        <div class="sent_mss cleafix">
                                            <div class="lef_mail_details">
                                                <?php if($mail_info->type == 1) { ?><a target="_blank" href="<?php echo base_url().'thong-tin-gia-su.'.$mail_info->id.'.html'; ?>" title="Xem thông tin gia sư">
                                                    <img src="<?php echo get_thumnails($img[0],70,70); ?>" width="70" height="70" alt=""/>
                                                </a>
                                                <?php } else { ?>
                                                    <img src="<?php echo get_thumnails(base_url().'skin/front-end/images/logo.png',70,70);  ?>" width="70" height="70" alt=""/>
                                                <?php } ?>
                                            </div>
                                            <div class="content_1">
                                                <div class="content_mail">
                                                    <?php echo '<p style="font-weight:bold;font-size:16px;text-transform:capitalize;color:#7DB520">'.$mail_info->name.'<span style="color:#777777;font-weight:normal;font-size:10px;float:right;">( '.$email->date.' )</span></p> '.$email->description; ?>
                                                </div>
                                                <span class="arr">&nbsp;</span>
                                            </div>
                                        </div>
                                    </div>
                                    <?php } else { ?>
                                            <div class="box_noidung clearfix">
                                                <div class="sent_mss cleafix">
                                                    <div class="lef_mail_details" style="float: right;">
                                                        <?php if($mail_info->type == 1) { ?><a target="_blank" href="<?php echo base_url().'thong-tin-gia-su.'.$mail_info->id.'.html'; ?>" title="Xem thông tin gia sư">
                                                            <img src="<?php echo get_thumnails($img[0],70,70); ?>" width="70" height="70" alt=""/>
                                                        </a>
                                                        <?php } else { ?>
                                                            <img src="<?php echo get_thumnails(base_url().'skin/front-end/images/logo.png',70,70);  ?>" width="70" height="70" alt=""/>
                                                        <?php } ?>
                                                    </div>
                                                    <div class="content_1 box-rep">
                                                        <div class="content_mail">
                                                            <?php echo '<p style="font-weight:bold;font-size:16px;text-transform:capitalize;color:#7DB520;">Bạn '.'<span style="color:#777777;font-weight:normal;font-size:10px;float:right;">( '.$email->date.' )</span></p>'.$email->description; ?>
                                                        </div>
                                                        <span class="arr2">&nbsp;</span>
                                                    </div>
                                                </div>
                                            </div>
                                    <?php } ?>
                            <?php
                        } ?>
                        </section>
					<br/>
					<div class="box_traloi clearfix">
						<form action="<?php echo base_url().'email/chi-tiet/'.$this->uri->segment(3).'.html'; ?>" method="POST">
							<textarea  name="mes_traloi" id="mss_traloi" placeholder="Nhập tin nhắn trả lời của bạn"></textarea>
							<input value="Trả lời" type="submit" class="btn_view submit_rep" name="submit" />
							<div class="clearfix"></div>
							<h4>Vui lòng k nhập địa chỉ liên lạc, số điện thoại và email của bạn.</h4>
						</form>
						<?php if(!empty($thongbao)) { echo $thongbao;} ?>
					</div>
				</article>
                        <?php   
                }
       ?>
    </div>		<!-- /.primary -->
		</div>
		<!-- /.wrapper -->
<!-- Script Show Button Rep -->
<script>
    $(document).ready(function(){
       $('.studen_mess').hover(function(){
            $(this).find('.btn_repmail').fadeIn(400);
            $(this).find('.btn_repmail').click(function(){
               $(this).parent().parent().find('.box_rep').show(400)
            });
       },function(){
            $(this).find('.btn_repmail').fadeOut(400);
       });
    });
</script>
<style>
.email_list
{
    position:relative;
}
.email_list a
{
    text-decoration:none;
}
.date_sent
{
    position:absolute;
    right:10px;
    top:70px;
    color:#777777;
    font-weight:bold;
}
.info_mail
{
    width:100px;
    float:left;
}
.take_mss_tutor {
    width: 95px;
}
</style>
